package info.ms.neural.flowrate;

import info.ms.neural.Adaptor;
import info.ms.neural.flowrate.runner.IFlowrateRunner;

/**
 * 流量控制
 * 
 * @author lry
 */
public interface IFlowrate<REQ, RES> extends Adaptor {

	/**
	 * 流量控制器
	 * <br>
	 * 第一步:QPS流控<br>
	 * 第二步:并发流控<br>
	 * @param flowrateId 流控ID
	 * @param req 请求对象
	 * @param engine
	 * @return
	 * @throws Throwable
	 */
	RES flowrate(String flowrateId, REQ req, IFlowrateRunner<REQ, RES> engine) throws Throwable;
	
}
